import Vuex from "vuex"
import Vue from "vue"
import user from "./modules/user"
import persistence from "vuex-uniapp-persistence";
Vue.use(Vuex)

const store=new Vuex.Store({
    plugins: [persistence()],
    state:{
        safeArea:uni.getWindowInfo().safeArea,
        capButton:uni.getMenuButtonBoundingClientRect()
    },
    getters:{
        token:(state)=>state.user?.token
    },
    mutations:{},
    actions:{},
    modules:{user}
})

export default store